import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;

public class IOFile { // Esto es como leer y escribir un archivo

	public static void writeToFile(String text, String as) {
		try {
			BufferedWriter bw = new BufferedWriter(new FileWriter(new File(
					"E:\\" + as + ".txt")));
			bw.write(text);
			bw.newLine();
			bw.close();

		} catch (Exception e) {
		}
	}

	public static void readFile(String as) {
		try {
			InputStream is = new FileInputStream("E:\\" + as + ".txt");
			BufferedReader br = new BufferedReader(new InputStreamReader(is));
			String line;
			while ((line = br.readLine()) != null) {
				System.out.println(line);
			}
			br.close();
		} catch (Exception e) {
		}

	}

	public static void main(String[] args) {
		IOFile io = new IOFile();
	}
}
